-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define Git and date constants in executables only #4681
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed in chat, having the version header & source file as part of a CMake add_library(... OBJECT)
would make this a bit cleaner, overall approach looks good
Each executable has to also link to the VERSION_PROJECT. objects don't have a link step so it can't be included in sub-dependencies |
Description
This moves the definitions
CHATTERINO_{GIT_{HASH, RELEASE, COMMIT, MODIFIED}, CMAKE_GEN_DATE}
into the executable only. This removes them from thechatterino-lib
target, which in turn makes it possible to cache, since the definitions will be the same across many runs (mentioned in #4680 (comment)).Local compile times will also be improved (e.g. when recompiling on a new day).
To test this, you should rerun the Windows CI after this day (to get a new generator date) and check the Post Setup sccache (Windows) step for the amount of cache-hits.